package demo2;

import java.util.Arrays;

public class Test {
    public static int[] twoSum(int[] nums, int target) {
        for( int i = 0; i < nums.length; i++){
            for(int j = i+1; j < nums.length; j++){
                if(nums[i] + nums[j] == target){
                    int[] c = {i ,j} ;
                    return c;

                }
            }
        }
        return null;
    }
    public static void main(String[] args) {
        int [] nums = {3,2,4};
        int[] a = twoSum(nums,6);
        System.out.println(Arrays.toString(a));
    }
}
